<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>eRPC API Reference: message_buffer.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">eRPC API Reference
   &#160;<span id="projectnumber">Rev. 1.5.0</span>
   </div>
   <div id="projectbrief">NXP Semiconductors</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>API&#160;Reference</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('message__buffer_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">message_buffer.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="message__buffer_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright (c) 2014-2016, Freescale Semiconductor, Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * Copyright 2016 NXP</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * All rights reserved.</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * Redistribution and use in source and binary forms, with or without modification,</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * are permitted provided that the following conditions are met:</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * o Redistributions of source code must retain the above copyright notice, this list</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *   of conditions and the following disclaimer.</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * o Redistributions in binary form must reproduce the above copyright notice, this</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *   list of conditions and the following disclaimer in the documentation and/or</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> *   other materials provided with the distribution.</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> * o Neither the name of the copyright holder nor the names of its</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> *   contributors may be used to endorse or promote products derived from this</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> *   software without specific prior written permission.</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment"> * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"> * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment"> * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment"> * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment"> * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment"> * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#ifndef _EMBEDDED_RPC__MESSAGE_BUFFER_H_</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#define _EMBEDDED_RPC__MESSAGE_BUFFER_H_</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &quot;erpc_common.h&quot;</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#include &lt;cstddef&gt;</span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="comment">// Classes</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceerpc.html">erpc</a> {</div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="classerpc_1_1_message_buffer.html">   58</a></span>&#160;<span class="keyword">class </span><a class="code" href="classerpc_1_1_message_buffer.html">MessageBuffer</a></div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;{</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="classerpc_1_1_message_buffer.html#a643b05b55a92e65382b4b96617ce2b61">   66</a></span>&#160;    <a class="code" href="classerpc_1_1_message_buffer.html#a643b05b55a92e65382b4b96617ce2b61">MessageBuffer</a>()</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    : m_buf(0)</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    , m_len(0)</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    , m_used(0)</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    {</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    }</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="classerpc_1_1_message_buffer.html#a7785b972a2ed8719a7afcd8f15c1b3ca">   81</a></span>&#160;    <a class="code" href="classerpc_1_1_message_buffer.html#a7785b972a2ed8719a7afcd8f15c1b3ca">MessageBuffer</a>(uint8_t *buffer, uint16_t length)</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    : m_buf(buffer)</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    , m_len(length)</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    , m_used(0)</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    {</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    }</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div><div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="classerpc_1_1_message_buffer.html#ae68c8d9c1ded075f6a85ecd92fb958be">   96</a></span>&#160;    <span class="keywordtype">void</span> <span class="keyword">set</span>(uint8_t *buffer, uint16_t length)</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    {</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;        m_buf = buffer;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;        m_len = length;</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;        m_used = 0;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    }</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div><div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="classerpc_1_1_message_buffer.html#acaa92d2046df5b4fe0dd0f72c80db8c5">  108</a></span>&#160;    uint8_t *<span class="keyword">get</span>() { <span class="keywordflow">return</span> m_buf; }</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div><div class="line"><a name="l00115"></a><span class="lineno"><a class="line" href="classerpc_1_1_message_buffer.html#aca6e73cdfa0ee1b44b9a24795d726cee">  115</a></span>&#160;    <span class="keyword">const</span> uint8_t *<span class="keyword">get</span>() <span class="keyword">const</span> { <span class="keywordflow">return</span> m_buf; }</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div><div class="line"><a name="l00122"></a><span class="lineno"><a class="line" href="classerpc_1_1_message_buffer.html#a00a45ec75a5c502c6a4d387dc341b319">  122</a></span>&#160;    uint16_t <a class="code" href="classerpc_1_1_message_buffer.html#a00a45ec75a5c502c6a4d387dc341b319">getLength</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_len; }</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;</div><div class="line"><a name="l00129"></a><span class="lineno"><a class="line" href="classerpc_1_1_message_buffer.html#add0dea93d5d72418413ba2cdbaac68be">  129</a></span>&#160;    uint16_t <a class="code" href="classerpc_1_1_message_buffer.html#add0dea93d5d72418413ba2cdbaac68be">getUsed</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_used; }</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div><div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="classerpc_1_1_message_buffer.html#af83a725b03371d97b636765ede86b184">  136</a></span>&#160;    uint16_t <a class="code" href="classerpc_1_1_message_buffer.html#af83a725b03371d97b636765ede86b184">getFree</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_len - m_used; }</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;</div><div class="line"><a name="l00143"></a><span class="lineno"><a class="line" href="classerpc_1_1_message_buffer.html#aa0170a6e243e15fc7271d792624b3e96">  143</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classerpc_1_1_message_buffer.html#aa0170a6e243e15fc7271d792624b3e96">setUsed</a>(uint16_t used) { m_used = used; }</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    <a class="code" href="group__infra.html#ga5f8872e58f09a16d192bf664f9898651">erpc_status_t</a> read(uint16_t offset, <span class="keywordtype">void</span> *data, uint32_t length);</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    <a class="code" href="group__infra.html#ga5f8872e58f09a16d192bf664f9898651">erpc_status_t</a> write(uint16_t offset, <span class="keyword">const</span> <span class="keywordtype">void</span> *data, uint32_t length);</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    <a class="code" href="group__infra.html#ga5f8872e58f09a16d192bf664f9898651">erpc_status_t</a> copy(<span class="keyword">const</span> <a class="code" href="classerpc_1_1_message_buffer.html">MessageBuffer</a> *other);</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    <span class="keywordtype">void</span> swap(<a class="code" href="classerpc_1_1_message_buffer.html">MessageBuffer</a> *other);</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    <span class="keyword">operator</span> uint8_t *() { <span class="keywordflow">return</span> m_buf; }</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    <span class="keyword">operator</span> <span class="keyword">const</span> uint8_t *() <span class="keyword">const</span> { <span class="keywordflow">return</span> m_buf; }</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;    uint8_t &amp;operator[](<span class="keywordtype">int</span> index) { <span class="keywordflow">return</span> m_buf[index]; }</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    <span class="keyword">const</span> uint8_t &amp;operator[](<span class="keywordtype">int</span> index)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_buf[index]; }</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;</div><div class="line"><a name="l00157"></a><span class="lineno"><a class="line" href="classerpc_1_1_message_buffer_1_1_cursor.html">  157</a></span>&#160;    <span class="keyword">class </span><a class="code" href="classerpc_1_1_message_buffer_1_1_cursor.html">Cursor</a></div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    {</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    <span class="keyword">public</span>:</div><div class="line"><a name="l00165"></a><span class="lineno"><a class="line" href="classerpc_1_1_message_buffer_1_1_cursor.html#a840a43c1643b1bcad235120f7d0343e6">  165</a></span>&#160;        <a class="code" href="classerpc_1_1_message_buffer_1_1_cursor.html#a840a43c1643b1bcad235120f7d0343e6">Cursor</a>()</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;        : m_buffer(NULL)</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;        , m_pos(NULL)</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;        , m_remaining(0)</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;        {</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;        }</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;</div><div class="line"><a name="l00179"></a><span class="lineno"><a class="line" href="classerpc_1_1_message_buffer_1_1_cursor.html#a0e15e87d9811aa62005be4a985b94451">  179</a></span>&#160;        <a class="code" href="classerpc_1_1_message_buffer_1_1_cursor.html#a0e15e87d9811aa62005be4a985b94451">Cursor</a>(<a class="code" href="classerpc_1_1_message_buffer.html">MessageBuffer</a> *buffer)</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;        : m_buffer(buffer)</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;        , m_pos(buffer-&gt;<a class="code" href="classerpc_1_1_message_buffer_1_1_cursor.html#aab4d7097dfd02bf98c094a82caddd2f2">get</a>())</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;        , m_remaining(buffer-&gt;<a class="code" href="classerpc_1_1_message_buffer.html#a00a45ec75a5c502c6a4d387dc341b319">getLength</a>())</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;        {</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;        }</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;        <span class="keywordtype">void</span> <span class="keyword">set</span>(<a class="code" href="classerpc_1_1_message_buffer.html">MessageBuffer</a> *buffer);</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;</div><div class="line"><a name="l00200"></a><span class="lineno"><a class="line" href="classerpc_1_1_message_buffer_1_1_cursor.html#aab4d7097dfd02bf98c094a82caddd2f2">  200</a></span>&#160;        uint8_t *<span class="keyword">get</span>() { <span class="keywordflow">return</span> m_pos; }</div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;</div><div class="line"><a name="l00209"></a><span class="lineno"><a class="line" href="classerpc_1_1_message_buffer_1_1_cursor.html#acc4f2758fb84c37b0346b554f29862f4">  209</a></span>&#160;        <span class="keyword">const</span> uint8_t *<span class="keyword">get</span>() <span class="keyword">const</span> { <span class="keywordflow">return</span> m_pos; }</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;</div><div class="line"><a name="l00216"></a><span class="lineno"><a class="line" href="classerpc_1_1_message_buffer_1_1_cursor.html#a278f9e0126b9b6b062b1855fe5516896">  216</a></span>&#160;        uint16_t <a class="code" href="classerpc_1_1_message_buffer_1_1_cursor.html#a278f9e0126b9b6b062b1855fe5516896">getRemaining</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_remaining; }</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;</div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;        <a class="code" href="group__infra.html#ga5f8872e58f09a16d192bf664f9898651">erpc_status_t</a> <a class="code" href="classerpc_1_1_message_buffer_1_1_cursor.html#a13613fadb3bb88585f5802ff845259a4">read</a>(<span class="keywordtype">void</span> *data, uint32_t length);</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;</div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;        <a class="code" href="group__infra.html#ga5f8872e58f09a16d192bf664f9898651">erpc_status_t</a> <a class="code" href="classerpc_1_1_message_buffer_1_1_cursor.html#a7e3588d2e063d827dbe5dbf72d5952e8">write</a>(<span class="keyword">const</span> <span class="keywordtype">void</span> *data, uint32_t length);</div><div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;</div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;        <span class="keyword">operator</span> uint8_t *() { <span class="keywordflow">return</span> m_pos; }</div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;        <span class="keyword">operator</span> <span class="keyword">const</span> uint8_t *() <span class="keyword">const</span> { <span class="keywordflow">return</span> m_pos; }</div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;        uint8_t &amp;operator[](<span class="keywordtype">int</span> index) { <span class="keywordflow">return</span> m_pos[index]; }</div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;        <span class="keyword">const</span> uint8_t &amp;operator[](<span class="keywordtype">int</span> index)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_pos[index]; }</div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;</div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;        <a class="code" href="classerpc_1_1_message_buffer_1_1_cursor.html">Cursor</a> &amp;operator+=(uint16_t n)</div><div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;        {</div><div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;            m_pos += n;</div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;            m_remaining -= n;</div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;        }</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;        <a class="code" href="classerpc_1_1_message_buffer_1_1_cursor.html">Cursor</a> &amp;operator-=(uint16_t n)</div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;        {</div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;            m_pos -= n;</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;            m_remaining += n;</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;        }</div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;</div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;        <a class="code" href="classerpc_1_1_message_buffer_1_1_cursor.html">Cursor</a> &amp;operator++()</div><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;        {</div><div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;            ++m_pos;</div><div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;            --m_remaining;</div><div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;        }</div><div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;        <a class="code" href="classerpc_1_1_message_buffer_1_1_cursor.html">Cursor</a> &amp;operator--()</div><div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;        {</div><div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;            --m_pos;</div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;            ++m_remaining;</div><div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;        }</div><div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;</div><div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;    <span class="keyword">private</span>:</div><div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;        <a class="code" href="classerpc_1_1_message_buffer.html">MessageBuffer</a> *m_buffer; </div><div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;        uint8_t *m_pos;          </div><div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;        uint16_t m_remaining;    </div><div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;    };</div><div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;</div><div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;    uint8_t *<span class="keyword">volatile</span> m_buf;  </div><div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;    uint16_t <span class="keyword">volatile</span> m_len;  </div><div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;    uint16_t <span class="keyword">volatile</span> m_used; </div><div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;};</div><div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;</div><div class="line"><a name="l00288"></a><span class="lineno"><a class="line" href="classerpc_1_1_message_buffer_factory.html">  288</a></span>&#160;<span class="keyword">class </span><a class="code" href="classerpc_1_1_message_buffer_factory.html">MessageBufferFactory</a></div><div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;{</div><div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00296"></a><span class="lineno"><a class="line" href="classerpc_1_1_message_buffer_factory.html#a9897093c65b390b0c7f1595384ad9029">  296</a></span>&#160;    <a class="code" href="classerpc_1_1_message_buffer_factory.html#a9897093c65b390b0c7f1595384ad9029">MessageBufferFactory</a>() {}</div><div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;</div><div class="line"><a name="l00301"></a><span class="lineno"><a class="line" href="classerpc_1_1_message_buffer_factory.html#ac2b0d9092be2a6e757dcc4bdc8baefd5">  301</a></span>&#160;    <span class="keyword">virtual</span> <a class="code" href="classerpc_1_1_message_buffer_factory.html#ac2b0d9092be2a6e757dcc4bdc8baefd5">~MessageBufferFactory</a>() {}</div><div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;</div><div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;    <span class="keyword">virtual</span> <a class="code" href="classerpc_1_1_message_buffer.html">MessageBuffer</a> create() = 0;</div><div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;</div><div class="line"><a name="l00315"></a><span class="lineno"><a class="line" href="classerpc_1_1_message_buffer_factory.html#a27ba896a8eb9a1aee6b02894acd724cf">  315</a></span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classerpc_1_1_message_buffer_factory.html#a27ba896a8eb9a1aee6b02894acd724cf">createServerBuffer</a>() { <span class="keywordflow">return</span> <span class="keyword">true</span>; }</div><div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;</div><div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;    <span class="keyword">virtual</span> <a class="code" href="group__infra.html#ga5f8872e58f09a16d192bf664f9898651">erpc_status_t</a> prepareServerBufferForSend(<a class="code" href="classerpc_1_1_message_buffer.html">MessageBuffer</a> *message);</div><div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;</div><div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> dispose(<a class="code" href="classerpc_1_1_message_buffer.html">MessageBuffer</a> *buf) = 0;</div><div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;};</div><div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;</div><div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;} <span class="comment">// namespace erpc</span></div><div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;</div><div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;<span class="preprocessor">#endif // _EMBEDDED_RPC__MESSAGE_BUFFER_H_</span></div><div class="ttc" id="group__infra_html_ga5f8872e58f09a16d192bf664f9898651"><div class="ttname"><a href="group__infra.html#ga5f8872e58f09a16d192bf664f9898651">erpc_status_t</a></div><div class="ttdeci">int32_t erpc_status_t</div><div class="ttdoc">Type used for all status and error return values. </div><div class="ttdef"><b>Definition:</b> erpc_common.h:108</div></div>
<div class="ttc" id="classerpc_1_1_message_buffer_1_1_cursor_html_a0e15e87d9811aa62005be4a985b94451"><div class="ttname"><a href="classerpc_1_1_message_buffer_1_1_cursor.html#a0e15e87d9811aa62005be4a985b94451">erpc::MessageBuffer::Cursor::Cursor</a></div><div class="ttdeci">Cursor(MessageBuffer *buffer)</div><div class="ttdoc">Constructor. </div><div class="ttdef"><b>Definition:</b> message_buffer.h:179</div></div>
<div class="ttc" id="classerpc_1_1_message_buffer_html_a643b05b55a92e65382b4b96617ce2b61"><div class="ttname"><a href="classerpc_1_1_message_buffer.html#a643b05b55a92e65382b4b96617ce2b61">erpc::MessageBuffer::MessageBuffer</a></div><div class="ttdeci">MessageBuffer()</div><div class="ttdoc">Constructor. </div><div class="ttdef"><b>Definition:</b> message_buffer.h:66</div></div>
<div class="ttc" id="classerpc_1_1_message_buffer_html_a00a45ec75a5c502c6a4d387dc341b319"><div class="ttname"><a href="classerpc_1_1_message_buffer.html#a00a45ec75a5c502c6a4d387dc341b319">erpc::MessageBuffer::getLength</a></div><div class="ttdeci">uint16_t getLength() const </div><div class="ttdoc">This function returns length of buffer. </div><div class="ttdef"><b>Definition:</b> message_buffer.h:122</div></div>
<div class="ttc" id="classerpc_1_1_message_buffer_1_1_cursor_html_a840a43c1643b1bcad235120f7d0343e6"><div class="ttname"><a href="classerpc_1_1_message_buffer_1_1_cursor.html#a840a43c1643b1bcad235120f7d0343e6">erpc::MessageBuffer::Cursor::Cursor</a></div><div class="ttdeci">Cursor()</div><div class="ttdoc">Constructor. </div><div class="ttdef"><b>Definition:</b> message_buffer.h:165</div></div>
<div class="ttc" id="classerpc_1_1_message_buffer_factory_html_a27ba896a8eb9a1aee6b02894acd724cf"><div class="ttname"><a href="classerpc_1_1_message_buffer_factory.html#a27ba896a8eb9a1aee6b02894acd724cf">erpc::MessageBufferFactory::createServerBuffer</a></div><div class="ttdeci">virtual bool createServerBuffer()</div><div class="ttdoc">This function inform server if it has to create buffer for received message. </div><div class="ttdef"><b>Definition:</b> message_buffer.h:315</div></div>
<div class="ttc" id="classerpc_1_1_message_buffer_html_af83a725b03371d97b636765ede86b184"><div class="ttname"><a href="classerpc_1_1_message_buffer.html#af83a725b03371d97b636765ede86b184">erpc::MessageBuffer::getFree</a></div><div class="ttdeci">uint16_t getFree() const </div><div class="ttdoc">This function returns length of free space of buffer. </div><div class="ttdef"><b>Definition:</b> message_buffer.h:136</div></div>
<div class="ttc" id="classerpc_1_1_message_buffer_html_aa0170a6e243e15fc7271d792624b3e96"><div class="ttname"><a href="classerpc_1_1_message_buffer.html#aa0170a6e243e15fc7271d792624b3e96">erpc::MessageBuffer::setUsed</a></div><div class="ttdeci">void setUsed(uint16_t used)</div><div class="ttdoc">This function sets length of used space of buffer. </div><div class="ttdef"><b>Definition:</b> message_buffer.h:143</div></div>
<div class="ttc" id="classerpc_1_1_message_buffer_1_1_cursor_html"><div class="ttname"><a href="classerpc_1_1_message_buffer_1_1_cursor.html">erpc::MessageBuffer::Cursor</a></div><div class="ttdoc">Cursor within a MessageBuffer. </div><div class="ttdef"><b>Definition:</b> message_buffer.h:157</div></div>
<div class="ttc" id="classerpc_1_1_message_buffer_1_1_cursor_html_a13613fadb3bb88585f5802ff845259a4"><div class="ttname"><a href="classerpc_1_1_message_buffer_1_1_cursor.html#a13613fadb3bb88585f5802ff845259a4">erpc::MessageBuffer::Cursor::read</a></div><div class="ttdeci">erpc_status_t read(void *data, uint32_t length)</div><div class="ttdoc">Read data from current buffer. </div><div class="ttdef"><b>Definition:</b> message_buffer.cpp:103</div></div>
<div class="ttc" id="classerpc_1_1_message_buffer_1_1_cursor_html_a278f9e0126b9b6b062b1855fe5516896"><div class="ttname"><a href="classerpc_1_1_message_buffer_1_1_cursor.html#a278f9e0126b9b6b062b1855fe5516896">erpc::MessageBuffer::Cursor::getRemaining</a></div><div class="ttdeci">uint16_t getRemaining() const </div><div class="ttdoc">Return remaining free space in current buffer. </div><div class="ttdef"><b>Definition:</b> message_buffer.h:216</div></div>
<div class="ttc" id="classerpc_1_1_message_buffer_html"><div class="ttname"><a href="classerpc_1_1_message_buffer.html">erpc::MessageBuffer</a></div><div class="ttdoc">Represents a memory buffer containing a message. </div><div class="ttdef"><b>Definition:</b> message_buffer.h:58</div></div>
<div class="ttc" id="classerpc_1_1_message_buffer_html_add0dea93d5d72418413ba2cdbaac68be"><div class="ttname"><a href="classerpc_1_1_message_buffer.html#add0dea93d5d72418413ba2cdbaac68be">erpc::MessageBuffer::getUsed</a></div><div class="ttdeci">uint16_t getUsed() const </div><div class="ttdoc">This function returns length of used space of buffer. </div><div class="ttdef"><b>Definition:</b> message_buffer.h:129</div></div>
<div class="ttc" id="namespaceerpc_html"><div class="ttname"><a href="namespaceerpc.html">erpc</a></div><div class="ttdoc">Logging messages objects used for logging sent/received messages. </div><div class="ttdef"><b>Definition:</b> arbitrated_client_manager.h:47</div></div>
<div class="ttc" id="classerpc_1_1_message_buffer_1_1_cursor_html_aab4d7097dfd02bf98c094a82caddd2f2"><div class="ttname"><a href="classerpc_1_1_message_buffer_1_1_cursor.html#aab4d7097dfd02bf98c094a82caddd2f2">erpc::MessageBuffer::Cursor::get</a></div><div class="ttdeci">uint8_t * get()</div><div class="ttdoc">Return position in buffer. </div><div class="ttdef"><b>Definition:</b> message_buffer.h:200</div></div>
<div class="ttc" id="classerpc_1_1_message_buffer_factory_html_a9897093c65b390b0c7f1595384ad9029"><div class="ttname"><a href="classerpc_1_1_message_buffer_factory.html#a9897093c65b390b0c7f1595384ad9029">erpc::MessageBufferFactory::MessageBufferFactory</a></div><div class="ttdeci">MessageBufferFactory()</div><div class="ttdoc">Constructor. </div><div class="ttdef"><b>Definition:</b> message_buffer.h:296</div></div>
<div class="ttc" id="classerpc_1_1_message_buffer_html_a7785b972a2ed8719a7afcd8f15c1b3ca"><div class="ttname"><a href="classerpc_1_1_message_buffer.html#a7785b972a2ed8719a7afcd8f15c1b3ca">erpc::MessageBuffer::MessageBuffer</a></div><div class="ttdeci">MessageBuffer(uint8_t *buffer, uint16_t length)</div><div class="ttdoc">Constructor. </div><div class="ttdef"><b>Definition:</b> message_buffer.h:81</div></div>
<div class="ttc" id="classerpc_1_1_message_buffer_1_1_cursor_html_a7e3588d2e063d827dbe5dbf72d5952e8"><div class="ttname"><a href="classerpc_1_1_message_buffer_1_1_cursor.html#a7e3588d2e063d827dbe5dbf72d5952e8">erpc::MessageBuffer::Cursor::write</a></div><div class="ttdeci">erpc_status_t write(const void *data, uint32_t length)</div><div class="ttdoc">Read data from current buffer. </div><div class="ttdef"><b>Definition:</b> message_buffer.cpp:118</div></div>
<div class="ttc" id="classerpc_1_1_message_buffer_factory_html"><div class="ttname"><a href="classerpc_1_1_message_buffer_factory.html">erpc::MessageBufferFactory</a></div><div class="ttdoc">Abstract interface for message buffer factory. </div><div class="ttdef"><b>Definition:</b> message_buffer.h:288</div></div>
<div class="ttc" id="classerpc_1_1_message_buffer_factory_html_ac2b0d9092be2a6e757dcc4bdc8baefd5"><div class="ttname"><a href="classerpc_1_1_message_buffer_factory.html#ac2b0d9092be2a6e757dcc4bdc8baefd5">erpc::MessageBufferFactory::~MessageBufferFactory</a></div><div class="ttdeci">virtual ~MessageBufferFactory()</div><div class="ttdoc">ClientManager destructor. </div><div class="ttdef"><b>Definition:</b> message_buffer.h:301</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.5-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul class="foot">
    <li class="footer">&copy; 2016 NXP Semiconductors. All rights reserved.
    </li>
  </ul>
</div>
</body>
</html>
